<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="sec" uri="http://www.springframework.org/security/tags" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<sec:authentication property="principal" var="currentPrincipal" scope="page"/>

<fmt:setBundle basename="ApplicationMessage"/>
<fmt:setLocale value="zh_CN"/>

<!DOCTYPE html>
<html lang="zh-CN">
<head>

  <%@ include file="/WEB-INF/include/meta.jsp" %>
  <%@ include file="/WEB-INF/include/css.jsp" %>

</head>
<body class="ms-theme-blue">

  <%@ include file="/WEB-INF/include/header.jsp" %>
  <%@ include file="/WEB-INF/include/submenu.jsp" %>

  <div class="container-fluid ms-container has-ms-sidemenu">

    <ol class="ms-breadcrumb breadcrumb">
      <li class="active">司机车辆关系修改</li>
    </ol>

    <div class="ms-content-layout ">
      <form class="form-horizontal ms-form form-personal-info" method="POST" action="${ctx.host}/relation-drivers/${driver.id}"
            data-validate="true" data-redirect="${ctx.host}/relation-drivers">
        
        <input type="hidden" name="_method" value="PATCH">
        <input type="hidden" name="companyId" value="${driver.organization.id}">
        
        <div class="form-group ms-form-group" style="margin: 30px 0;">
	        <label class="col-xs-4 control-label">驳运车：</label>
	        <div class="col-xs-3 modal-search-warp">
	          <input type="text" name="vehicle" value="${empty driver.vehicleId ? '' : persist.vehicle(driver.vehicleId).code.concat(' - ').concat(persist.vehicle(driver.vehicleId).name)}" 
	               class="form-control vehicle-search modal-search" data-validate="required"
	               data-org="companyId" data-value-name="vehicleId" placeholder="请填写驳运车" data-modal-search="#modal-search-vehicle" tabindex="1" autocomplete="off">
	             <input type="hidden" name="vehicleId" value="${driver.vehicleId}">
	          <a href="javascript:void(0);" class="btn" data-koala-search="true" data-target="#modal-search-vehicle" data-toggle="modal">
	            <span class="glyphicon glyphicon-align-justify" aria-hidden="true"></span>
	          </a>
	        </div>
	      </div>
	      
	      <div class="form-group ms-form-group">
          <div class="col-xs-6 col-xs-offset-3 ms-operation-group top-margin-20 text-center">
            <div class="col-xs-5">
              <button type="button" class="btn btn-block btn-default btn-go-back">取消</button>
            </div>

            <div class="col-xs-5">
              <button type="submit" class="btn btn-block btn-primary">保存</button>
            </div>
          </div>
        </div>
        
      </form>
    </div>
    
  </div>
    
  <%@ include file="/WEB-INF/include/script.jsp" %>
  <d:resource type="script" root="${ctx.resource}/build" src="js/page/supplier/management/relation/relation-edit.js"/>
  <script type="text/javascript">
    require(['page/supplier/management/relation/relation-edit'], function (page) {
      page.init()
    })
  </script>

</body>
</html>